import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'

const routes = [
  {
    path: '/',
    name: 'home',
    component: HomeView,
    redirect:'/user',
    children:[
      {path: '/user', component: () => import('../views/user/UserView.vue')},
      {path: '/dict', component: () => import('../views/dictionary/DictView.vue')},
      {path: '/dictOption', component: () => import('../views/dictionary/DictOptionView.vue')},
      {path: '/petBreed', component: () => import('../views/pet/PetBreedView.vue')},
      {path: '/petSupplies', component: () => import('../views/pet/PetSuppliesView.vue')},
      {path: '/petAdoption', component: () => import('../views/trading/PetAdoptionView.vue')},
      {path: '/petSales', component: () => import('../views/trading/PetSalesView.vue')},
      {path: '/petForum', component: () => import('../views/community/PetForumView.vue')},
      {path: '/medicine', component: () => import('../views/service/MedicineView.vue')},
      {path: '/grooming', component: () => import('../views/service/GroomingView.vue')},
      {path: '/boarding', component: () => import('../views/service/BoardingView.vue')},
      {path: '/funeral', component: () => import('../views/service/FuneralView.vue')},
      {path: '/petBirthdayReminder', component: () => import('../views/personalizedFunction/PetBirthdayReminderView.vue')}
    ]
  },
  {path: '/login', component: () => import('../views/LoginView')}
]

const router = createRouter({
  history: createWebHistory(process.env.BASE_URL),
  routes
})

export default router